<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>海角论坛 | 查询</title>
</head>
<body>
<h1 align="center">查询论坛信息</h1>
<h4 align="center"><a href="${pageContext.request.contextPath }/WEB-INF/jsp/addBbs.jsp">添加帖子</a></h4>
<center>
    <form action="" method="post">
        讨论版区：
        <select name="sortId">
            <option value="0">---全部---</option>
            <option value="1">Java技术</option>
            <option value="2">前端开发</option>
            <option value="3">Python</option>
            <option value="4">C++</option>
        </select>
        <button type="submit">搜索</button>
    </form>
</center>
<table border="1" width="1000" align="center">
    <tr bgcolor="#6495ed">
        <th>帖子ID</th>
        <th>标题</th>
        <th>作者</th>
        <th>发布时间</th>
        <th>回复次数</th>
    </tr>
    <%--使用jstl+el表达式遍历--%>
    <c:forEach var="detail" items="${requestScope.list}">
        <tr>
            <td>${detail.id}</td>
            <td>${detail.title}</td>
            <td>${detail.author}</td>
            <td><fmt:formatDate value="${detail.createDate}" pattern="yyyy-MM-dd"/> </td>
            <td>${detail.replyCount}</td>
        </tr>
    </c:forEach>
</table>
</body>
</html>